import request from '@/utils/request'

export function getGatewayPage(data) {
  return request({
    url: `/gateway/query?keyword=${data.keyword}&page=${data.page}&limit=${data.limit}`,
    method: 'get' // query
  })
}

export function addGateway(data) {
  return request({
    url: `/gateway/insert`,
    method: 'post',
    data: data // body
  })
}

export function updateGateway(data) {
  return request({
    url: `/gateway/update`,
    method: 'put',
    data: data
  })
}

export function deleteGateway(data) {
  return request({
    url: `/gateway/delete/${data.gatewayId}`,
    method: 'delete'
  })
}

export function deleteGateways(data) {
  return request({
    url: `/gateway/deletes?ids%5B%5D=${data.item}`,
    method: 'delete'
  })
}
